package com.flower.rest;

import com.flower.domain.ApiResult;
import com.flower.domain.entity.category.Category;
import com.flower.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

@RestController
@Slf4j
@RequestMapping("/reception/category")
public class CategoryController {

    @Resource
    private CategoryService categoryService;



    public ApiResult<Category> categoryList(){
        //先查询出所有的分类列表 来
        List<Category> list = categoryService.list();
        List<Category> collect = list.stream().filter(item -> item.getIsFa() == 1).collect(Collectors.toList());
        for (Category category : collect) {
            System.out.println(category.getIsFa());
        }
        return null;
    }



}
